package com.youngjun.auth.security;

import com.youngjun.common.security.service.AuthCallbackService;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Service
public class AuthCallbackServiceImpl implements AuthCallbackService {

    @Override
    public void loginSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
        System.out.println("loginSuccess");
    }

    @Override
    public void loginFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
        System.out.println("loginFailure");
    }

    @Override
    public void logoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
        System.out.println("logoutSuccess");
    }

    @Override
    public void authEntryPoint(HttpServletRequest request, HttpServletResponse response, AuthenticationException e) {
        System.out.println("authEntryPoint");
    }

    @Override
    public void accessDenied(HttpServletRequest request, HttpServletResponse response, AccessDeniedException e) {
        System.out.println("accessDenied");
    }

}
